const baseURL=`http://localhost:9898`;
export default function fetchData(options) {
	return new Promise((resolve,reject)=>{
		uni.request({
			...options,
			url:`${baseURL}${options.url}`,
			success:(response)=>{
				if(response.statusCode ===200) {
					resolve(response.data);
				}
				else{
					reject(new Error('获取数据失败'))
				}
			},
			fail:(error)=>{
				reject(error)
			}
		})
	})
	
}
